#include "simple/support/meta/flatten.hpp"
#include "simple/support/meta/list.hpp"

#include <type_traits>

using namespace simple::support;

int main()
{
	static_assert(std::is_same_v<
		meta::flatten_once_t<meta::list<>>,
		meta::list<>
	>);

	static_assert(std::is_same_v<
		meta::flatten_once_t<meta::list<int, int>>,
		meta::list<int, int>
	>);

	static_assert(std::is_same_v<
		meta::flatten_once_t<meta::list<int, meta::list<bool, char>, int>>,
		meta::list<int, bool, char, int>
	>);

	// only one level, no recursion
	static_assert(std::is_same_v<
		meta::flatten_once_t<meta::list<
			int,
			meta::list
			<
				bool,
				meta::list
				<
					long,
					short
				>,
				char
			>,
			int
		>>,
		meta::list
		<
			int,
			bool,
			meta::list
			<
				long,
				short
			>,
			char,
			int
		>
	>);

	// complete with recursion
	static_assert(std::is_same_v<
		meta::flatten_t<meta::list<
			int,
			meta::list
			<
				bool,
				meta::list
				<
					long,
					short
				>,
				char
			>,
			int
		>>,
		meta::list
		<
			int,
			bool,
			long,
			short,
			char,
			int
		>
	>);

	return 0;
}
